import { createSSRApp } from 'vue'
import pinia from './stores'

import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  // 创建一个全局状态,标识是否已经完成了 onLaunched 事件
  app.config.globalProperties.$onLaunched = new Promise(resolve => {
    app.config.globalProperties.$isResolve = resolve; // 将 resolve 函数暴露给全局
  });
  app.use(pinia)
  return {
    app,
  }
}
